﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Community.CsharpSqlite.Entity
{

    /*
** The following structure keeps track of state information for the
** count() aggregate function.
*/
    //typedef struct CountCtx CountCtx;
    public class CountCtx
    {
        private Mem _M;
        private long _n;

        public Mem Context
        {
            get { return _M; }
            set
            {
                _M = value;
                if (_M == null || _M.z == null)
                    _n = 0;
                else _n = Convert.ToInt64(_M.z);
            }
        }

        public long n
        {
            get { return _n; }
            set
            {
                _n = value;
                if (_M != null) _M.z = _n.ToString();
            }
        }
    }
}
